<?php if (!defined('THINK_PATH')) exit(); echo W('Template/top');?>
<div class="wrapper clearfix content" style='border: 1px solid #ddd'>
    <?php echo W('Template/left');?>
    <div class="rightbox pull-right">
        <div class="ur-here">您当前的位置：<a href="<?php echo U('Tour/index',array('id'=>I('get.id')));?>">产品列表</a>&gt;新增路线&gt;团期/位控
        </div>
        <div class="cTitle2">团期/位控</div>
        <div class="nav ckAct">
            <span><a href="<?php echo U('Tour/edit',array('id'=>I('get.id'),'tid'=>$skuid));?>" class="a-1"><i class="i-1"></i>基本信息</a></span>
            <span><a href="<?php echo U('Tour/editPlan',array('id'=>I('get.id'),'tid'=>$skuid));?>" class="a-2"><i class="i-2"></i>详细行程</a></span>
            <span><a href="<?php echo U('Tour/extendEdit',array('id'=>I('get.id'),'tid'=>$skuid));?>" class="a-3"><i
                    class="i-3"></i>扩展信息</a></span>
            <span class="active"><a href="<?php echo U('Tour/editSku',array('id'=>I('get.id'),'tid'=>$skuid));?>" class="a-4"><i
                    class="i-4"></i>团期/位控</a></span>
        </div>
        <div class="main-search pull-right" style="padding-bottom: 0px;">
            <button type="button" class="btn btn-info" onclick="addSku('', <?php echo ($skuid); ?>, '<?php echo (setEncrypt($skuid)); ?>', '新增团期/位控', 'showdates')"
                    style="margin:10px 0 10px 38px;">新增常规
            </button>
            <button type="button" class="btn btn-info"
                    onclick="addCruiseSku('', <?php echo ($skuid); ?>, '<?php echo (setEncrypt($skuid)); ?>', '新增团期/位控', 'showCruiseDates')" style="margin-right:0px;">新增游轮
            </button>
            <button type="button" class="btn btn-danger" onclick="jqchk()">删除</button>
            <input type="hidden" name="start_time" id="times" value=""/>
            <input type="hidden" name="addSku" id="addSku" value="/index.php/Admin/Tour/editSku/id/35/tid/4021.html"/>
            <input type="hidden" id="chkr" value="<?php echo U('Tour/skuDelete');?>"/>
            <input type="hidden" id="chke" value="<?php echo U('Tour/skuEdit');?>"/>
            <input type="hidden" id="chka" value="<?php echo U('Tour/addSku');?>"/>
            <input type="hidden" id="cruise" value="<?php echo U('Tour/addCruiseSku');?>"/>
            <input type="hidden" id="editCruise" value="<?php echo U('Tour/editCruiseSku');?>"/>
            <input type="hidden" value="<?php echo ($aid); ?>" id='kid'/>
        </div>
        <table class="cTable table-hover" width="100%">
            <tr>
                <th width="8%" style="padding-left:5px;"><input type="checkbox" id="male" onclick="selectAll(this);"/>&nbsp;<label
                        for="male" style="font-weight: bold">全选</label></th>
                <th>出团时间</th>
                <th>成人同行价</th>
                <th>成人零售价</th>
                <th>儿童同行价</th>
                <th>儿童零售价</th>
                <th>报名截至（天）</th>
                <th>可售人数</th>
                <th>操作</th>
            </tr>
            <?php if(is_array($skuInfo)): $i = 0; $__LIST__ = $skuInfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                    <td style="padding-left:10px;text-align: left"><input name="subBox" type="checkbox"
                                                                          class="checkitem" value="<?php echo (setEncrypt($vo["id"])); ?>"/></td>
                    <?php if($vo["cruise"] != ''): ?><td><a href="javascript:void(0)" data-toggle="tooltip" data-placement="top"
                               title="<?php echo ($vo["cruise"]); ?>"><?php echo (substr($vo["start_time"],0,10)); ?></a></td>
                        <?php else: ?>
                        <td><?php echo (substr($vo["start_time"],0,10)); ?></td><?php endif; ?>
                    <td class="text-c5"><?php echo (GetYuan($vo["price_adult_agency"])); ?></td>
                    <td class="text-c1"><?php echo (GetYuan($vo["price_adult_list"])); ?></td>
                    <td class="text-c5"><?php echo (GetYuan($vo["price_child_agency"])); ?></td>
                    <td class="text-c1"><?php echo (GetYuan($vo["price_child_list"])); ?></td>
                    <td><?php echo ($vo["pre_join_days"]); ?></td>
                    <td><?php echo ($vo["sku"]); ?></td>
                    <td>
                        <div class="btn-group pull-right">
                            <button type="button" style="padding:3px 7px" class="btn btn-default dropdown-toggle"
                                    data-toggle="dropdown" aria-expanded="false">
                                操作 <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" role="menu" style="margin: 0px;background: #eee">
                                <?php if($vo["cruise"] != ''): ?><li><a onclick="editCruiseSku(<?php echo ($vo["id"]); ?>, '<?php echo (setEncrypt($vo["id"])); ?>', '编辑团期/位控', 'showCruiseDateOne')"
                                           style="cursor: pointer;padding:0px 14px;">修改</a></li>
                                    <?php else: ?>
                                    <li><a onclick="editSku(<?php echo ($vo["id"]); ?>, '<?php echo (setEncrypt($vo["id"])); ?>', '编辑团期/位控', 'showdateOne')"
                                           style="cursor: pointer;padding:0px 14px;">修改</a></li><?php endif; ?>
                                <li><a onclick="jqchk('<?php echo (setEncrypt($vo["id"])); ?>')" style="cursor: pointer;padding:0px 14px;">删除</a></li>
                            </ul>
                        </div>
                    </td>
                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
        </table>
        <?php if(!empty($skuInfo)): ?><div class="pagebox">
                <?php echo ($page); ?>
            </div><?php endif; ?>
        <div class="theme-popover">
            <div class="theme-poptit">
                <a title="关闭" class="closes">&times;</a>

                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel"></h4>
                </div>
                <div class="modal-body">
                    <div class="dateCoenter" style="display: none ;float:left">
                        <div id="timeDateShow" class="timeDateShow"></div>
                        <div class="timeDateShowsgs">
                            <input type="hidden" id="dataValues" value=""/>
                            <span>可以选择多个,通过鼠标拖动或者点击选择日期</span>
                        </div>
                    </div>
                    <div class="dateCoenterOne" style="display: none ;float:left">
                        <input type="text" id="timestartOne" placeholder="2015-01-01"
                               style="width:76%;border:1px solid #ccc;height:35px; padding-left:5px;" value=""
                               calss="Wdate" id="d4322"
                               onFocus="WdatePicker({minDate: '#F<?php echo ($dp["$D('d4321',{d:3"]); ?>);}'})"/>
                        <span></span>
                    </div>
                    <div class="modal_right">
                        <table class="table">
                            <thead>
                            <tr>
                                <th style="text-align: center;width: 27%">类型</th>
                                <th style="text-align: center">同行价</th>
                                <th style="text-align: center">建议零售价</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <th style="text-align: right;border:none">成人价格：</th>
                                <td style="border:none"><input type="text" id="aagency" class="form-control"
                                                               name="adult_agency"/></td>
                                <td style="border:none"><input type="text" id="alist" class="form-control"
                                                               name="adult_list"/></td>
                            </tr>
                            <tr>
                                <th style="text-align: right;border:none">儿童价格：</th>
                                <td style="border:none"><input type="text" id="cagency" class="form-control"
                                                               name="child_agency"/></td>
                                <td style="border:none"><input type="text" id="clist" class="form-control"
                                                               name="child_list"/></td>
                            </tr>
                            <tr>
                                <th style="text-align: right;border:none">单房差(每晚)：</th>
                                <td style="border:none"><input type="text" id="hagency" class="form-control"
                                                               name="hotel_agency"/></td>
                                <td style="border:none"><input type="text" id="hlist" class="form-control"
                                                               name="hotel_list"/></td>
                            </tr>
                            <tr>
                                <th style="text-align: right;border:none">可售总数：</th>
                                <td style="border:none"><input type="text" id="num" name="num" class="form-control"
                                                               placeholder="0" value="0"/></td>
                            </tr>
                            <tr>
                                <th style="text-align: right;border:none">虚拟售出数：</th>
                                <td style="border:none"><input type="text" id="sold" name="sold" class="form-control"
                                                               placeholder="0" value="0"/></td>
                            </tr>
                            <tr style="position: relative">
                                <th style="text-align: right;border:none">报名截止时间：</th>
                                <td style="border:none"><input type="text" id="days" class="form-control"
                                                               name="join_days" placeholder="1" value="1"/></td>
                                <td colspan="2" style="border:none">
                                    <em class="markday">天</em>
                                    <a href="#" class="tooltip-test mark" data-toggle="tooltip"
                                       title="在截止日期当日24小时之后停止报名"></a>
                                </td>
                            </tr>
                            <tr>
                                <th style="text-align: right;border:none">备注：</th>
                                <td colspan="3" style="border:none"><input id="desc" name="desc" id="desc"
                                                                           class="form-control"
                                                                           style="width:255px;padding:8px;padding-left:3px;"
                                                                           value="<?php echo ($sku_info_one["memo"]); ?>"></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer pull-right" style="border:none">
                <button type="button" class="btn btn-warning" id="button">保存</button>
                <button type="button" class="btn btn-default " id="reset">取消</button>
            </div>
        </div>

        <div class="theme-popover-mask"></div>


        <div class="cruiseDiv" style="display: none">
            <div style="width: 800px;margin-top: -180px;position: fixed;top: 30%;z-index: 22;">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close closeCruise">
                            &times;
                        </button>
                        <h4 class="modal-title" id="myModalLabel">
                            新增游轮团期/位控
                        </h4>
                    </div>
                    <div class="modal-body">
                        <div style="height:350px;">
                            <div class="dateCruiseCoenter" style="display: none ;width:313px;height: 340px;float:left;">
                                <div id="timeDateShowCruise" class="timeDateShow"></div>
                                <div class="timeDateShowsgs">
                                    <input type="hidden" id="cruiseDataValues" value=""/>
                                    <span>可以选择多个,通过鼠标拖动或者点击选择日期</span>
                                </div>
                            </div>
                            <div class="dateCruiseCoenterOne" style="display: none ;float:left">
                                <input type="text" id="timeCruiseStartOne" placeholder="2015-01-01"
                                       style="width:76%;border:1px solid #ccc;height:35px; padding-left:5px;" value=""
                                       calss="Wdate" id="d4322"
                                       onFocus="WdatePicker({minDate: '#F<?php echo ($dp["$D('d4321',{d:3"]); ?>);}'})"/>
                                <span></span>
                            </div>

                            <textarea style="width:450px;height:340px;float: right" name="cruise"
                                      class="cruise"></textarea>
                        </div>

                        <div style="margin-top: 5px;">
                            最小价格：<input type='text' name='min_price' id='min_price' placeholder='请输入最小价格'> 元起
                        <span style="float:right;margin-top: 10px;"><a href="http://cdn.lydlr.com/public/cruise.html"
                                                                       target="_blank"
                                                                       style="color:red">游轮添加示例</a></span>
                        </div>

                    </div>
                    <div class="modal-footer">
                        <div class="pull-right">
                            <button type="button" class="btn btn-primary" id="saveCruiseInfo">
                                提交
                            </button>
                            <button type="button" class="btn btn-default" data-dismiss="modal" id="closeCuriseDiv">关闭
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>


    </div>
</div>
<?php echo W('Template/bottom');?>
<script type="text/javascript" src="/Public/js/sku.js?v=7"></script>
<script type="text/javascript" src="/Public/js/cruiseSku.js?v=7"></script>
<script> $(function () {
    $("[data-toggle='tooltip']").tooltip();
});</script>
</body>
</html>